<?php
namespace app\index\Validate;
use think\Validate;

class Login extends Validate{

    //验证规则
	protected $rule = [
	            'us_email'     =>'require|email|unique:user',
                'us_password'  =>'require|max:16|min:6',
                'code'         =>'require',
                'account'      =>'require'
	        ];

	protected $message  =  [
           'us_email.require'    => '邮箱必须填写',
           'us_email.email'      => '邮箱格式不正确',
           'us_email.unique'     => '该邮箱已被注册',
           'us_password.require' => '密码不能为空',
           'us_password.max'     => '密码不能超过16位',
           'us_password.min'     => '密码不能低于6位',
           'code.require'        => '验证码不能为空',
           'account.require'     => '登录账号不能为空',
           ];

    protected $scene = [
        'register'  =>  ['us_email','us_password','code'],
        'login'     =>  ['account','us_password'],
        'send'      =>  ['us_email'],
        'reset'     =>  ['us_email'=>'require|email'],
        'resetPwd'  =>  ['us_email'=>'require|email','us_password','code'],
    ];
    
}